#!/bin/bash

export IMAGE_NAME="my/jenkins"
export CONTAINER_NAME="my-jenkins"

docker build -t $IMAGE_NAME .

sleep 3

docker run -d --name $CONTAINER_NAME \
 -p 8080:8080 -p 50000:50000 \
 -v /etc/timezone:/etc/timezone \
 -v /etc/localtime:/etc/localtime \
 -v /home/jenkins_home:/var/jenkins_home \
 -v /var/docker_data/jenkins/settings:/var/settings \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -v $(which docker):/usr/bin/docker \
 -v $(which docker-compose):/usr/bin/docker-compose \
 $IMAGE_NAME
